<template>
	<!-- 提现明细 -->
	<view>
		<!-- #ifdef APP-PLUS -->
		<view class="status_bar"></view>  
		<!-- #endif -->
		<navbar title="提现明细" />
		<noData v-if="withdrawalList.length===0" />
		<view class="main" v-for="(item,index) in withdrawalList" :key="index" v-else>
			<view class="top">
				<view class="title">提现到微信零钱</view>
				<view class="status">{{item.status | status}}</view>
			</view>
			<view class="bot">
				<view class="time">{{item.createtime}}</view>
				<view class="money">-¥{{item.price}}</view>
			</view>
		</view>
		<!-- 加载更多 -->
		<pullDownRefresh :status="loading" v-if="withdrawalList.length>0" />
	</view>
</template>

<script>
	import pullDownRefresh from '@/components/pullDownRefresh'
	export default {
		components:{
			pullDownRefresh
		},
		data() {
			return {
				page:1,
				withdrawalList:[],//提现明细列表
				loading:0
			}
		},
		filters:{
			status(v){
				switch(v){
					case '0':
						return '已拒绝'
					case '1':
						return '审核中'
					case '2':
						return '已到账'
					default:
						break;
				}
			}
		},
		onLoad() {
			this.getWithdrawList();
		},
		methods: {
			getWithdrawList(){
				this.loading = 1;
				this.$api.sharewithdrawlis({offset:this.page}).then(res=>{
					if(res.length>0){
						this.loading = 0;
						this.withdrawalList = this.withdrawalList.concat(res);
					}else{
						this.loading = 3;
						// uni.showToast({
						// 	title:'没有更多了~',
						// 	icon:'none'
						// })
					}
				})
			},
		}
	}
</script>

<style lang="scss">
page{
	padding-top: calc(var(--status-bar-height) + 100rpx);
}
.main{
	width: 690rpx;
	background: #FFFFFF;
	border-radius: 10rpx;
	padding: 30rpx;
	margin: 30rpx auto 0;
	
	.top{
		@include between;
		
		.title{
			font-size: 28rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #333333;
		}
		.status{
			font-size: 28rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #FF6408;
		}
	}
	.bot{
		@include between;
		margin-top: 26rpx;
		
		.time{
			font-size: 24rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #666666;
		}
		.money{
			font-size: 28rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #FF0000;
		}
	}
}
</style>
